# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=pam-u2f
pkgver=1.1.1
pkgrel=1
pkgdesc="Pluggable Authentication Module (PAM) for U2F"
url="https://developers.yubico.com/pam-u2f/"
arch="all"
license="BSD-2-Clause"
makedepends="linux-pam-dev openssl1.1-compat-dev libfido2-dev"
options="!check" # need yubikey plugged in on live machine
subpackages="$pkgname-doc"
source="https://developers.yubico.com/pam-u2f/Releases/pam_u2f-$pkgver.tar.gz"
builddir="$srcdir/pam_u2f-$pkgver"

# secfixes:
#   1.1.1-r0:
#     - CVE-2021-31924

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-pam-dir=/lib/security
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
ca81c78e67c17c369117e9d38e50033eaa96e0b15673521db2c382de1aa2566f7406fb43801a5938758480966c5e7316943769db5be826983d3865710e0274c1  pam_u2f-1.1.1.tar.gz
"
